package com.atguigu12.wapper;

import org.junit.Test;

/**
 * ClassName: WapperTest1
 * Package: com.atguigu12.wapper
 * Description:
 *
 * @Author ZY
 * @Create 16:15
 * @Version 1.0
 */
public class WapperTest1 {

    /*
    基本数据类型、包装类 --> String类型
    String类型 -->  基本数据类型、包装类
    */

    @Test
    public void test1(){
        int i1 = 10;
        String str = String.valueOf(i1);
        System.out.println(str);

        boolean b1 = true;
        Boolean b2 = b1;
        String str2 = String.valueOf(b1);
        String str3 = String.valueOf(b2);


    }

    @Test
    public void test2(){
        String s1 = "123";
        int i1 = Integer.parseInt(s1);
        System.out.println(i1);

        String s2 = "true";
        boolean b1 = Boolean.parseBoolean(s2);
        System.out.println(b1);

        //特别的
//        String s3 = "123a";
//        int i2 = Integer.parseInt(s3);//报错:NumberFormatException

    
    }
}
